package com.chukun.flink.stream.window.join.extractor;

import com.chukun.flink.stream.window.join.bean.UserTrade;
import org.apache.flink.api.common.eventtime.TimestampAssigner;

/**
 * @author chukun
 * @version 1.0.0
 * @description 抽取事件时间
 * @createTime 2022年05月26日 23:49:00
 */
public class TradeEventTimestampExtractor implements TimestampAssigner<UserTrade> {
    @Override
    public long extractTimestamp(UserTrade trade, long timestamp) {
        return trade.getTradeTime().getTime();
    }
}
